<template>
    <el-pagination
        background
        layout="prev, pager, next,total"
        :total="total"
        :page-size="pagination[sizeName]"
        :current-page.sync="pagination[pageName]"
        @current-change="handleCurrentChange"
        @size-change="handleSizeChange"
        :style="'float:' + float"
    ></el-pagination>
</template> 
<script>
export default {
    props: {
        pagination: Object,
        total:Number,
        sizeName: {
            type: String,
            default: "pageSize"
        },
        pageName: {
            type: String,
            default: "pageNumber"
        },
        float: String
    },
    methods: {
        handleCurrentChange(cpage) {
            this.pagination[this.pageName] = cpage;
            this.$emit("currpage");
        },
        handleSizeChange(psize) {
            this.pagination[this.sizeName] = psize;
        }
    }
};
</script>

